using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ManagedAPI;

namespace UnitTest
{
	/// <summary>
	/// Summary description for KindTest
	/// </summary>
	[TestClass]
	public class KindTest
	{
		private static bool mOpenResult;
		public KindTest()
		{
			
		}

		#region Additional test attributes
		//
		// You can use the following additional attributes as you write your tests:
		//
		// Use ClassInitialize to run code before running the first test in the class
		//[ClassInitialize()]
		//public static void MyClassInitialize(TestContext testContext){}
		//
		// Use ClassCleanup to run code after all tests in a class have run
		//[ClassCleanup()]
		//public static void MyClassCleanup() { }
		//
		// Use TestInitialize to run code before running each test 
		[TestInitialize()]
		public void MyTestInitialize()
		{
            mOpenResult = Database.Open(UnderstandGlobalData.GetFileName());
			Assert.IsTrue(mOpenResult);
		}
		//
		// Use TestCleanup to run code after each test has run
		[TestCleanup()]
		public void MyTestCleanup()
		{
			Database.Close();
			mOpenResult = false;
		}
		//
		#endregion

		[TestMethod]
		public void KindTest_Basic()
		{
			if (mOpenResult)
			{
				Entity[] entList = Database.GetFileEntities();
				Kind file_1_kind = entList[0].Kind;

				Assert.IsTrue( file_1_kind.IsKind("C Header File") );
				Assert.IsTrue( file_1_kind.IsKindFile() );
				Kind invert = file_1_kind.Inverse;
				Assert.AreEqual("", invert.NameLong);

				Assert.AreEqual("C Header File", file_1_kind.NameLong);
				Assert.AreEqual("File", file_1_kind.NameShort);
				//Assert.IsTrue(UdbKind.Udb_cHeaderFile == file_1_kind.ThisKind);
			}
		}


	}
}
